#!/bin/sh
# install nodejs
set -euxo pipefail
profile_file='/etc/profile.d/nodejs.sh'

if [ -f ${profile_file} ]; then
    mv ${profile_file} ${profile_file}.bak
fi

cat >${profile_file} <<'EOF'
# nodejs env

export NODEJS_HOME=/opt/node/
export PATH=$NODEJS_HOME/bin:$PATH
EOF